<me:UIVAF x:Class="WPFExcelReport.TFVA10"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"    
                    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:VA="clr-namespace:WPFExcelReport;assembly=TVAART" 
                    xmlns:VAK="clr-namespace:WPFExcelReport;assembly=TVAKOLL" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN" 
                    xmlns:LM="clr-namespace:WPFExcelReport;assembly=TLMFKART" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"  
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    FontSize="14"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIVAF.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:RGB2ColorConverter x:Key="rgb"/>
    </me:UIVAF.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel>
                <WrapPanel>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button   Click="EditCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Edit.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Click="DeleteCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Remove.png" />
                            </Button.Background>
                        </Button>
                    </Grid>

                    <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,Converter={StaticResource bv}}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button   Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                            </Button.Background>
                        </Button>
                    </Grid>

                </WrapPanel>
                <WrapPanel >
                    <Button  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <VA:TSVA06 ART="{Binding ART,ElementName=TV}" KOLL="{Binding KOLL,ElementName=TV}" 
                               ARTST="F"  />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=季节:}}"></TextBlock>
                        <ex:TXT72 MaxLength="5" Grid.Column="1"  Text="{Binding KOLL,ElementName=TV}" Width="50" KeyUp="Query_KeyUp" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=品种:}}"></TextBlock>
                        <ex:TXT72 MaxLength="24" Grid.Column="1"  Text="{Binding ART,ElementName=TV}" Width="120" KeyUp="Query_KeyUp" />
                    </Grid>
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=供应商色号:}}"></TextBlock>
                        <ex:TXT72 MaxLength="10" Grid.Column="1"  Text="{Binding FARBE,ElementName=TV}" Width="120" KeyUp="Query_KeyUp" />
                    </Grid>
                    <Grid Margin="10,0,0,0" Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=供应商色号:}}"></TextBlock>
                        <ex:TXT72  Grid.Column="1" MaxLength="10"  
                               Text="{Binding DES,ElementName=TV,Converter={StaticResource ResourceKey=gb2312} }"  KeyUp="Query_KeyUp"  Width="120" />
                    </Grid>
                </WrapPanel>
            </WrapPanel>
           
        </StackPanel>
        <Grid Grid.Row="1" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="250"/>
            </Grid.ColumnDefinitions>
            <StackPanel HorizontalAlignment="Left">
                <WrapPanel>
                <WrapPanel  >
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                            </Button.Background>
                        </Button>

                    </Grid>
                    <WrapPanel Visibility="{Binding IsNew,ElementName=TV,Converter={StaticResource bv}}">
                        <VA:TSVA06 ARTST="F"  
                                   ORDERNUM="{Binding EXAUF,ElementName=TV}"
                                   dwVA="{Binding dwVA,ElementName=TV}" 
                                   KOLL="{Binding KOLL,ElementName=TV}"
                                   ART="{Binding ART,ElementName=TV}"/>
                        <CheckBox Grid.Column="2"  IsChecked="{Binding IsSelfColor,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=内部色号}}"/>
                        <Grid Margin="10,0,0,0" Visibility="{Binding IsSelfColor,ElementName=TV,Converter={StaticResource bv}}" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" FontSize="18"  Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                            <ex:TXT72 MaxLength="10" FontSize="18"  CharacterCasing="Upper" Grid.Column="1"  
                                      Text="{Binding VAFFARBE,ElementName=TV,Converter={StaticResource gb2312},ConverterParameter=10}" Width="150"  />
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" FontSize="18"  Text="{Binding Source={Localization:Translate Word=供应/生产色号:}}"></TextBlock>
                            <ex:TXT72 MaxLength="10" FontSize="18" CharacterCasing="Upper" Grid.Column="1"  Text="{Binding EXFARBE,ElementName=TV,Converter={StaticResource gb2312}}" Width="150"  />
                        </Grid>

                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                    </WrapPanel>
                </WrapPanel>
                <WrapPanel>
                    <Grid Margin="10,0,0,0" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                    <WrapPanel Visibility="{Binding IsCopy,ElementName=TV,Converter={StaticResource bv}}">
                        
                        <CheckBox Grid.Column="2"  IsChecked="{Binding IsSelfColor,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=内部色号}}"/>
                        <Grid Margin="10,0,0,0" Visibility="{Binding IsSelfColor,ElementName=TV,Converter={StaticResource bv}}" >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" FontSize="18"  Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                            <ex:TXT72 MaxLength="10" FontSize="18"  CharacterCasing="Upper" Grid.Column="1"  
                                      Text="{Binding VAFFARBE,ElementName=TV,Converter={StaticResource gb2312},ConverterParameter=10}" Width="150"  />
                        </Grid>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock   Grid.Column="0" FontSize="18"  Text="{Binding Source={Localization:Translate Word=供应/生产色号:}}"></TextBlock>
                            <ex:TXT72 MaxLength="10" FontSize="18" CharacterCasing="Upper" Grid.Column="1"  
                                      Text="{Binding EXFARBE,ElementName=TV,Converter={StaticResource gb2312}}" Width="150"  />
                        </Grid>

                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button   Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                                </Button.Background>
                            </Button>
                        </Grid>
                    
                </WrapPanel>
                </WrapPanel>
                </WrapPanel>
             
                <Expander Header="{Binding Source={Localization:Translate Word=按色卡}}" ExpandDirection="Right" IsExpanded="{Binding IsByCards,ElementName=TV}" Visibility="Collapsed">
                    <LM:TLM03    SelctionKey="LMFFARBE" Selects="{Binding COLORS,ElementName=TV}"
                                 IsAuto="True"
                                 CARDNO="ALL"
                                   IsEdit="{Binding IsEdit,ElementName=TV}"
                            IsSaved="{Binding IsSaved,ElementName=TV}"
                                   CR="{Binding ElementName=colorpicker, Path=R, Mode=TwoWay}" 
                               CG="{Binding ElementName=colorpicker, Path=G, Mode=TwoWay}" 
                               CB="{Binding ElementName=colorpicker, Path=B, Mode=TwoWay}"
                                 CRGB="{Binding ElementName=TV, Path=CRGB, Mode=TwoWay}" 
                                 EXAUF="{Binding PRART,ElementName=TV}"
                                 />
                </Expander>
                <WrapPanel>
                    <me:UIVA10 IsEdit="{Binding IsEdit,ElementName=TV}"/>
                    <WF:TSWF 
                         EXAUF="{Binding PRART,ElementName=TV}"
                         FARBE="{Binding FARBE,ElementName=TV}" 
                         FINISH="{Binding FINISH,ElementName=TV}" 
                         DESS="{Binding DESS,ElementName=TV}" 
                         COLORIT="{Binding COLORIT,ElementName=TV}" 
                         IsEdit="True"/>

                </WrapPanel>
                <VA:TFVA07 ORDERNUM="{Binding KEY,ElementName=TV}"
                               dwVA="{Binding dwVA,ElementName=TV}" 
                               />
                <WF:TWAFARBEN Name="cWFVA10" IsStock="False"  
                                   IsAuto="True"    
                                    IsYD="{Binding IsColorWeave,ElementName=cWS15}"
                                   IsEdit="{Binding IsEdit,ElementName=TV}"
                                   IsSaved="{Binding IsSaved,ElementName=TV}"
                                   ORDERNUM="{Binding PRART,ElementName=TV}"
                                   CGRP="{Binding FARBGRP,ElementName=TV}"/>
            </StackPanel>
            <DataGrid  Grid.Row="1" Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   IsReadOnly="True"
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}"  
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"   Margin="0,0,0,0"
                    > 
                <DataGrid.Columns> 
                    <DataGridTemplateColumn Width="40" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate >
                                <Grid >
                                    <TextBlock>
                                        <TextBlock.Background>
                                            <SolidColorBrush Color="{Binding RGB,Converter={StaticResource ResourceKey=rgb}}"></SolidColorBrush>
                                        </TextBlock.Background>
                                    </TextBlock>
                                </Grid>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Binding="{Binding Path=VAFART}" Header="{Binding Source={Localization:Translate Word=品种}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFFFARBE}" Header="{Binding Source={Localization:Translate Word=供应商色号}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFPART}" Header="{Binding Source={Localization:Translate Word=供应商品种}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFFARBGRP}" Header="{Binding Source={Localization:Translate Word=分组}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFBEZ, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色名}}"  Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=WAFBEZ, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=WAFGRPBEZ, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}"  Width="60" />
                    <DataGridTextColumn Binding="{Binding Path=VAFDESS, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=印花}}"  Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=VAFCOLORIT, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=配色}}"  Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=VAFBESCHICH, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=后整}}"  Width="40" />
                    <DataGridTextColumn Binding="{Binding Path=VAFPGROE, Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=尺码}}"  Width="40" /> 
                    <DataGridTextColumn Binding="{Binding Path=VAFNEUBEN}" Header="{Binding Source={Localization:Translate Word=创建}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFNEUDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFAENDBEN}" Header="{Binding Source={Localization:Translate Word=更改}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VAFAENDDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid  >
            <xctk:ColorCanvas  Grid.Row="0"  Grid.Column="1" Grid.RowSpan="2" Name="colorpicker" 
                           Width="250" />
            <ex:TPage  Grid.Row="2" Visibility="{Binding IsPage,Converter={StaticResource bv}}"/>
        </Grid>
        <Grid  Grid.Row="2"  Visibility="{Binding IsWS15,ElementName=TV,Converter={StaticResource bv}}">
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
                <WrapPanel>
                    <WS:TWS15  
                         IsEdit="{Binding IsEdit,ElementName=TV}"
                            IsSaved="{Binding IsSaved,ElementName=TV}"
                        EXAUF="{Binding PRART,ElementName=TV}" Name="cWS15"/>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=色号属性:}}"/>
                    <WF:TWS07  EXAUF="{Binding PRART,ElementName=TV}"  ZUART="C" Name="cC" />
                    <TextBlock Text="{Binding Source={Localization:Translate Word=整理属性:}}"/>
                    <WF:TWS07  EXAUF="{Binding PRART,ElementName=TV}" ZUART="B" Name="cF" />
                </WrapPanel>
            </StackPanel>
            <Grid Grid.Row="1" Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions> 
                <WF:TWS06C   
                    IsEdit="{Binding IsEdit,ElementName=TV}"
                            IsSaved="{Binding IsSaved,ElementName=TV}"
                    IsYD="{Binding IsColorWeave,ElementName=cWS15}"
                     WAFBEZ="{Binding WAFBEZ,ElementName=TV}"
                    WAFGRPBEZ="{Binding WAFGRPBEZ,ElementName=TV}"
                    Grid.Row="1" EXAUF="{Binding KEY,ElementName=cWS15}"/>
            </Grid>
            <Grid Grid.Row="1" Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions> 
                <WF:TWS06F Grid.Row="1" 
                           IsYD="{Binding IsColorWeave,ElementName=cWS15}"
                            IsEdit="{Binding IsEdit,ElementName=TV}"
                            IsSaved="{Binding IsSaved,ElementName=TV}"
                             WAFBEZ="{Binding WAFBEZ,ElementName=TV}"
                            WAFGRPBEZ="{Binding WAFGRPBEZ,ElementName=TV}"
                           EXAUF="{Binding KEY,ElementName=cWS15}"/>
            </Grid>
            <Grid Grid.Row="1" Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                </Grid.RowDefinitions>
                <TextBlock Text="{Binding Source={Localization:Translate Word=后整理}}"/>
                <WF:TWS06B Grid.Row="1" 
                           IsEdit="{Binding IsEdit,ElementName=TV}"
                            IsSaved="{Binding IsSaved,ElementName=TV}"
                             WAFBEZ="{Binding WAFBEZ,ElementName=TV}"
                            WAFGRPBEZ="{Binding WAFGRPBEZ,ElementName=TV}"
                           EXAUF="{Binding KEY,ElementName=cWS15}"/>
            </Grid>
        </Grid>
    </Grid>
</me:UIVAF>
